---
title: "Order"
description: "Utilities for controlling the order of flex and grid items."
---

import plugin from 'tailwindcss/lib/plugins/order'
import { Variants } from '@/components/Variants'
import { Disabling } from '@/components/Disabling'

export const classes = { plugin }

## Usage

Use `order-{order}` to render flex and grid items in a different order than they appear in the DOM.

```html lightBlue
<template preview>
  <div class="flex justify-between ...">
    <div class="order-last w-16 h-16 rounded-md bg-blue-500 text-white text-2xl font-extrabold flex items-center justify-center">1</div>
    <div class="w-16 h-16 rounded-md bg-blue-300 text-white text-2xl font-extrabold flex items-center justify-center">2</div>
    <div class="w-16 h-16 rounded-md bg-blue-300 text-white text-2xl font-extrabold flex items-center justify-center">3</div>
  </div>
</template>

<div class="flex justify-between ...">
  <div class="**order-last**">1</div>
  <div>2</div>
  <div>3</div>
</div>
```


## Responsive

To apply an order utility only at a specific breakpoint, add a `{screen}:` prefix to the existing class name. For example, adding the class `md:order-last` to an element would apply the `order-last` utility at medium screen sizes and above.

```html
<div class="flex">
  <div>1</div>
  <div class="order-first **md:order-last**">2</div>
  <div>3</div>
</div>
```

For more information about Tailwind's responsive design features, check out the [Responsive Design](/docs/responsive-design) documentation.

## Customizing

By default, Tailwind provides utilities for `order-first`, `order-last`, `order-none`, and an `order-{number}` utility for the numbers 1 through 12. You change, add, or remove these by editing the `theme.order` section of your `tailwind.config.js` file.

```diff-js
  // tailwind.config.js
  module.exports = {
    theme: {
      order: {
        first: '-9999',
        last: '9999',
-       none: '0',
+       normal: '0',
        '1': '1',
        '2': '2',
        '3': '3',
        '4': '4',
        '5': '5',
        '6': '6',
-       '7': '7',
-       '8': '8',
-       '9': '9',
-       '10': '10',
-       '11': '11',
-       '12': '12',
      }
    }
  }
```

### Variants

<Variants plugin="order" />

### Disabling

<Disabling plugin="order" />
